package gxdlxy.zx2202.chat5;

public class Example3 {
    public static void main(String[] args) {
        // 用户名：123456789， 密码：987654321
        String userName = "123456789";
        System.out.println("用户:" + userName);
        char[] cs = userName.toCharArray();
        char[] pwd = new char[cs.length];
        for(int i=0; i<cs.length; i++)
            pwd[i] = cs[8-i];
        System.out.println("密码:" + String.valueOf(pwd));

        StringBuffer strBuf = new StringBuffer();
        strBuf.append(userName);
        System.out.println("用户：" + strBuf);
        strBuf.reverse();
        System.out.println("密码：" + strBuf);
    }
}
